<?php
class DB 
{
    public static function getInstance()
    {
        $db = new PDO("mysql:dbname=hair;host=localhost", "hairdresser", "hair");
        if(!$db instanceof PDO) throw new Exception("Cannot connect to database");
        return $db;
    }
}
